<template>
	<img :src="imageUrl" :style="cssStyle">
</template>

<script>
	import constants from '@/utils/constants.js';
	export default {
		name: "ImageRenderer",
		props: ["componentModel", "tableData"],
		data() {
			return {
				imageUrl: "",
				cssStyle: "width:60px;height:40px;",
			}
		},
		beforeMount() {
			if (this.componentModel.cssStyle != undefined) {
				this.cssStyle = this.componentModel.cssStyle;
			}
		},
		mounted() {
			this.imageUrl = constants.ROOT_URL + "image/getImageByField?model=" + this.componentModel.model + "&id=" + this
				.tableData["id"] + "&dataField=" + this.componentModel.dataField + "&X-Token=" + window.localStorage
				.getItem("token");
		},
		methods: {
			setProp() {

			}
		},
	}
</script>

<style>
</style>
